package chapter;

public class object_extends {
    public static void main(String[] args) {
        Child c = new Child();
        System.out.print(c.name);
        c.test();
        //TODO 方法的重写，要求父类与子类的方法名，返回类型，参数列表样一样
    }
}
class Parent {
    String name = "zyh";
    void test(){
        System.out.println("test");
    }
}
class Child extends Parent {
    String name = "qxy";
    void test(){
        super.test();
        System.out.println(this.name);
        System.out.println(super.name);
        //TODO super上一级；this这一级
    }
}